<?php

declare(strict_types=1);

namespace app\start\model;

use lite\model\BaseModel;

class PostModel extends BaseModel
{
    protected $name = 'start_post';

    // 自动数据类型转换
    protected $type = [];

    // 自动 json 转换
    protected $json = [];


    public function category()
    {
        return $this->hasOne(CategoryModel::class,'id','category_id');
    }

    public function images()
    {
        return $this->hasMany(PostImageModel::class,'post_id','id');
    }
}